/**
 * 
 */
package com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.usersaction;

import com.alstudio.module.xmpp.protocol.xmpp.packact.ALXmppDomainConfig;
import com.alstudio.module.xmpp.protocol.xmpp.packact.IQNameSpace;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.AlXmlTag;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate;

/**
 * 添加收藏
 * @author alonso lee
 *
 */
public class AddUserFavoritesIQCreator extends BaseIQTemplate {
	
	/**
	 * 
	 */
	public AddUserFavoritesIQCreator(String jid,String domain) {
		// TODO Auto-generated constructor stub
		this.jid = jid;
		this.domain = domain;
	}

	/* (non-Javadoc)
	 * @see com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate#getIQXml()
	 */
	@Override
	public String getIQXml() {
		// TODO Auto-generated method stub
		AlXmlTag tag = new AlXmlTag("jid");
		tag.setText(jid);
		tagList.add(tag);
		mALIQCreator.setType(IQ_TYPE_SET);
		mALIQCreator.setNs(IQNameSpace.NS_ADD_FAVORITES);
		to = ALXmppDomainConfig.getALXmppDomainConfig().getDomainByNameSpace(mALIQCreator.getNs());
		mALIQCreator.setTo(to + domain);

		mALIQCreator.setTagList(tagList);
		String xml = "";
		try {
			xml = mALIQCreator.getXml();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return xml;
	}

}
